Skip to content

CmdPal: Fix missing primary context command for late-bound items#46131

Open
jiripolasek wants to merge 1 commit intomainfrom
dev/jpolasek/b/46129-cmdpal-fix-default-command-when-init-as-empty
Open

CmdPal: Fix missing primary context command for late-bound items#46131
jiripolasek wants to merge 1 commit intomainfrom
dev/jpolasek/b/46129-cmdpal-fix-default-command-when-init-as-empty

Conversation

@jiripolasek
Copy link
Collaborator

This PR does fix a bug where an item that starts with a null or empty primary command never adds that primary action to the context menu after the extension later provides a real command.

  • Creates the default primary context-menu item lazily when Command or Command.Name becomes available after SlowInitializeProperties()
  • Refreshes AllCommands, SecondaryCommand, and HasMoreCommands notifications for late command materialization and Show Details updates.
  • Adds unit tests to cover the fixed issue.

Summary of the Pull Request

PR Checklist

  • Communication: I've discussed this with core contributors already. If the work hasn't been agreed, this work might be rejected
  • Tests: Added/updated and all pass
  • Localization: All end-user-facing strings can be localized
  • Dev docs: Added/updated
  • New binaries: Added on the required places
  • Documentation updated: If checked, please file a pull request on our docs repo and link it here: #xxx

Detailed Description of the Pull Request / Additional comments

Validation Steps Performed

…d commands

- Creates the default primary context-menu item lazily when Command or Command.Name becomes available after SlowInitializeProperties().
- Refreshes AllCommands, SecondaryCommand, and HasMoreCommands notifications for late command materialization and Show Details updates.
- Keeps the snapshot-based context menu flow intact while ensuring the primary command participates in the context menu.
- Adds a unit test for the issue.
@jiripolasek jiripolasek self-assigned this Mar 14, 2026
@jiripolasek jiripolasek added the Product-Command Palette Refers to the Command Palette utility label Mar 14, 2026
@jiripolasek jiripolasek requested a review from zadjii-msft March 18, 2026 11:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Product-Command Palette Refers to the Command Palette utility

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CmdPal: Primary command missing in context menu when initial command or command name is null

1 participant